<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bilibili-干杯</title>
    <!-- 引入favicon图标 -->
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="./css/index.css">
    <link rel="stylesheet" href="./fonts/iconfont2.css">

</head>

<body>
    <!-- 头部模块 -->
    <header class="suspension">
        <div class="m-navbar">
            <a href="#" class="logo">
                <img src="images/logo-bilibili-pink.png" alt="">
            </a>
            <div class="right">
                <a href="#" class="search">
                    <i class="iconfont ic_search_tab"></i>
                </a>
                <a href="#" class="login">
                    <img src="images/login.png" alt="">
                </a>
                <div class="app-down">
                    <img src="images/download.png" alt="">
                    <!-- 下载app -->
                </div>
            </div>
        </div>
        <!-- 频道 -->
        <div class="channel-menu">
            <div class="tabs">
                <!-- 很宽的盒子 -->
                <div class="tabs-list">
                    <a href="#">首页</a>
                    <a href="#">动画</a>
                    <a href="#">番剧</a>
                    <a href="#">国创</a>
                    <a href="#">音乐</a>
                    <a href="#">舞蹈</a>
                    <a href="#">游戏</a>
                    <a href="#">知识</a>
                    <a href="#">科技</a>
                    <a href="#">运动</a>
                    <a href="#">汽车</a>
                    <a href="#">生活</a>
                    <a href="#">美食</a>
                    <div class="v-switcher"></div>
                </div>
            </div>
            <div class="after">
                <i class="iconfont general_pulldown_s"></i>
            </div>
        </div>
    </header>
    <!-- 主体部分 -->
    <div class="m-home">
        <div class="video-list">
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">武家坡之《有难同当》</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">《女神异闻录：夜幕魅影》2.1.1版本「夏天！泳装！Sea Time！」先导概览</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">武家坡之《有难同当》</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">《女神异闻录：夜幕魅影》2.1.1版本「夏天！泳装！Sea Time！」先导概览</p>
            </a> </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">《女神异闻录：夜幕魅影》2.1.1版本「夏天！泳装！Sea Time！」先导概览</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">武家坡之《有难同当》</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">《女神异闻录：夜幕魅影》2.1.1版本「夏天！泳装！Sea Time！」先导概览</p>
            </a>
            <a href="#" class="video-item">
                <div class="card">
                    <img src="images/102a.jpg
                    " alt="">
                    <div class="count">
                        <span class="plays">
                            <i class="iconfont icon_shipin_bofangshu"></i>118.2万
                        </span>
                        <span class="comments">
                            <i class="iconfont icon_shipin_danmushu"></i>
                            3840</span>
                    </div>
                </div>
                <p class="title ellipsis-2">《女神异闻录：夜幕魅影》2.1.1版本「夏天！泳装！Sea Time！」先导概览</p>
            </a>

        </div>
        <!-- 底部区域 -->
        <footer class="home-openapp">
            <div class="m-home-openapp">
                <i class="iconfont Navbar_logo"></i>
                <span>打开App，看你感兴趣的视频</span>
            </div>
        </footer>
    </div>

    <script>
        // 父元素添加事件委托
        const tab_list = document.querySelector('.tabs-list')
        const bar = document.querySelector('.tabs-list .v-switcher')
        tab_list.addEventListener('click', function (ev) {
            if (ev.target.tagName === 'A') {
                // console.log(ev.target.tagName);

                // console.log(ev.target.offsetLeft);
                const destination = ev.target.offsetLeft
                // console.log(origin_left);
                bar.style.transform = `translate(${destination}px)`

            }

        })
    </script>


</body>

</html>